Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/engine/main.cpp

Issue 11043057: First run page triggering (Closed)
Patch Set: Comments addressed Created July 20, 2013, 8:11 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/plugin/AdblockPlusClient.h » ('j') | src/plugin/PluginClass.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/engine/main.cpp
===================================================================
--- a/src/engine/main.cpp
+++ b/src/engine/main.cpp
@@ -8,6 +8,7 @@
#include "../shared/Dictionary.h"
#include "../shared/Utils.h"
#include "../shared/Version.h"
+#include "../shared/CriticalSection.h"
#include "Debug.h"
#include "Updater.h"
@@ -38,6 +39,9 @@
<< subscription->IsListed();
}
}
+
+ CriticalSection firstRunLock;
+ bool firstRunActionTaken = false;
Communication::OutputBuffer HandleRequest(Communication::InputBuffer& request)
{
@@ -167,11 +171,16 @@
}
break;
}
- case Communication::PROC_GET_IS_FIRST_RUN:
+ case Communication::PROC_IS_FIRST_RUN_ACTION_NEEDED:
+ {
+ CriticalSection::Lock lock(firstRunLock);
+ if (!firstRunActionTaken && filterEngine->IsFirstRun())
{
- response << filterEngine->IsFirstRun();
- break;
+ response << !firstRunActionTaken;
Wladimir Palant 2013/07/21 11:53:45 How about just response << true? No point obscurin
+ firstRunActionTaken = true;
}
Wladimir Palant 2013/07/21 11:53:45 What about: else response << false; Shouldn't
+ break;
+ }
}
return response;
« no previous file with comments | « no previous file | src/plugin/AdblockPlusClient.h » ('j') | src/plugin/PluginClass.cpp » ('J')

Powered by Google App Engine
This is Rietveld