Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(886)

Side by Side Diff: extensions/browser/api/test/test_api.cc

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « extensions/browser/api/test/test_api.h ('k') | extensions/browser/extension_function.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/api/test/test_api.h" 5 #include "extensions/browser/api/test/test_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 TestResetQuotaFunction::~TestResetQuotaFunction() {} 80 TestResetQuotaFunction::~TestResetQuotaFunction() {}
81 81
82 bool TestResetQuotaFunction::RunSafe() { 82 bool TestResetQuotaFunction::RunSafe() {
83 QuotaService* quota = 83 QuotaService* quota =
84 ExtensionSystem::Get(browser_context())->quota_service(); 84 ExtensionSystem::Get(browser_context())->quota_service();
85 quota->Purge(); 85 quota->Purge();
86 quota->violation_errors_.clear(); 86 quota->violation_errors_.clear();
87 return true; 87 return true;
88 } 88 }
89 89
90 bool TestSendMessageFunction::RunImpl() { 90 bool TestSendMessageFunction::RunAsync() {
91 scoped_ptr<PassMessage::Params> params(PassMessage::Params::Create(*args_)); 91 scoped_ptr<PassMessage::Params> params(PassMessage::Params::Create(*args_));
92 EXTENSION_FUNCTION_VALIDATE(params.get()); 92 EXTENSION_FUNCTION_VALIDATE(params.get());
93 content::NotificationService::current()->Notify( 93 content::NotificationService::current()->Notify(
94 chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, 94 chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE,
95 content::Source<TestSendMessageFunction>(this), 95 content::Source<TestSendMessageFunction>(this),
96 content::Details<std::string>(&params->message)); 96 content::Details<std::string>(&params->message));
97 return true; 97 return true;
98 } 98 }
99 99
100 TestSendMessageFunction::~TestSendMessageFunction() {} 100 TestSendMessageFunction::~TestSendMessageFunction() {}
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {} 137 TestWaitForRoundTripFunction::~TestWaitForRoundTripFunction() {}
138 138
139 bool TestWaitForRoundTripFunction::RunSafe() { 139 bool TestWaitForRoundTripFunction::RunSafe() {
140 scoped_ptr<WaitForRoundTrip::Params> params( 140 scoped_ptr<WaitForRoundTrip::Params> params(
141 WaitForRoundTrip::Params::Create(*args_)); 141 WaitForRoundTrip::Params::Create(*args_));
142 SetResult(new base::StringValue(params->message)); 142 SetResult(new base::StringValue(params->message));
143 return true; 143 return true;
144 } 144 }
145 145
146 } // namespace extensions 146 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/test/test_api.h ('k') | extensions/browser/extension_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698