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

Side by Side Diff: chrome/renderer/extensions/schema_generated_bindings.cc

Issue 9791011: Add experimental.alarms API to allow lazy background pages to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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 | « chrome/common/extensions/docs/samples.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/renderer/extensions/schema_generated_bindings.h" 5 #include "chrome/renderer/extensions/schema_generated_bindings.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // Get the current RenderView so that we can send a routed IPC message from 136 // Get the current RenderView so that we can send a routed IPC message from
137 // the correct source. 137 // the correct source.
138 content::RenderView* renderview = current_context->GetRenderView(); 138 content::RenderView* renderview = current_context->GetRenderView();
139 if (!renderview) 139 if (!renderview)
140 return v8::Undefined(); 140 return v8::Undefined();
141 141
142 std::string name = *v8::String::AsciiValue(args[0]); 142 std::string name = *v8::String::AsciiValue(args[0]);
143 const std::set<std::string>& function_names = 143 const std::set<std::string>& function_names =
144 v8_extension->extension_dispatcher_->function_names(); 144 v8_extension->extension_dispatcher_->function_names();
145 if (function_names.find(name) == function_names.end()) { 145 if (function_names.find(name) == function_names.end()) {
146 NOTREACHED() << "Unexpected function " << name; 146 NOTREACHED() << "Unexpected function " << name <<
147 ". Did you remember to register it with ExtensionFunctionRegistry?";
147 return v8::Undefined(); 148 return v8::Undefined();
148 } 149 }
149 150
150 if (!v8_extension->CheckCurrentContextAccessToExtensionAPI(name)) 151 if (!v8_extension->CheckCurrentContextAccessToExtensionAPI(name))
151 return v8::Undefined(); 152 return v8::Undefined();
152 153
153 GURL source_url; 154 GURL source_url;
154 WebSecurityOrigin source_origin; 155 WebSecurityOrigin source_origin;
155 WebFrame* webframe = current_context->web_frame(); 156 WebFrame* webframe = current_context->web_frame();
156 if (webframe) { 157 if (webframe) {
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 const std::string& extension_id) { 344 const std::string& extension_id) {
344 for (PendingRequestMap::const_iterator it = g_pending_requests.Get().begin(); 345 for (PendingRequestMap::const_iterator it = g_pending_requests.Get().begin();
345 it != g_pending_requests.Get().end(); ++it) { 346 it != g_pending_requests.Get().end(); ++it) {
346 if (it->second->extension_id == extension_id) 347 if (it->second->extension_id == extension_id)
347 return true; 348 return true;
348 } 349 }
349 return false; 350 return false;
350 } 351 }
351 352
352 } // namespace 353 } // namespace
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/samples.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698