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

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

Issue 107083006: More v8-API-related cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
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/dispatcher.h" 5 #include "chrome/renderer/extensions/dispatcher.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/alias.h" 9 #include "base/debug/alias.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 v8::Isolate* isolate = args.GetIsolate(); 232 v8::Isolate* isolate = args.GetIsolate();
233 std::string api_name = *v8::String::Utf8Value(args[0]->ToString()); 233 std::string api_name = *v8::String::Utf8Value(args[0]->ToString());
234 Feature::Availability availability = context_->GetAvailability(api_name); 234 Feature::Availability availability = context_->GetAvailability(api_name);
235 235
236 v8::Handle<v8::Object> ret = v8::Object::New(isolate); 236 v8::Handle<v8::Object> ret = v8::Object::New(isolate);
237 ret->Set(v8::String::NewFromUtf8(isolate, "is_available"), 237 ret->Set(v8::String::NewFromUtf8(isolate, "is_available"),
238 v8::Boolean::New(isolate, availability.is_available())); 238 v8::Boolean::New(isolate, availability.is_available()));
239 ret->Set(v8::String::NewFromUtf8(isolate, "message"), 239 ret->Set(v8::String::NewFromUtf8(isolate, "message"),
240 v8::String::NewFromUtf8(isolate, availability.message().c_str())); 240 v8::String::NewFromUtf8(isolate, availability.message().c_str()));
241 ret->Set(v8::String::NewFromUtf8(isolate, "result"), 241 ret->Set(v8::String::NewFromUtf8(isolate, "result"),
242 v8::Integer::New(availability.result())); 242 v8::Integer::New(isolate, availability.result()));
243 args.GetReturnValue().Set(ret); 243 args.GetReturnValue().Set(ret);
244 } 244 }
245 245
246 void GetModuleSystem(const v8::FunctionCallbackInfo<v8::Value>& args) { 246 void GetModuleSystem(const v8::FunctionCallbackInfo<v8::Value>& args) {
247 CHECK_EQ(args.Length(), 1); 247 CHECK_EQ(args.Length(), 1);
248 CHECK(args[0]->IsObject()); 248 CHECK(args[0]->IsObject());
249 v8::Handle<v8::Context> v8_context = 249 v8::Handle<v8::Context> v8_context =
250 v8::Handle<v8::Object>::Cast(args[0])->CreationContext(); 250 v8::Handle<v8::Object>::Cast(args[0])->CreationContext();
251 ChromeV8Context* context = dispatcher_->v8_context_set().GetByV8Context( 251 ChromeV8Context* context = dispatcher_->v8_context_set().GetByV8Context(
252 v8_context); 252 v8_context);
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 RenderView* background_view = 1669 RenderView* background_view =
1670 ExtensionHelper::GetBackgroundPage(extension_id); 1670 ExtensionHelper::GetBackgroundPage(extension_id);
1671 if (background_view) { 1671 if (background_view) {
1672 background_view->Send(new ExtensionHostMsg_EventAck( 1672 background_view->Send(new ExtensionHostMsg_EventAck(
1673 background_view->GetRoutingID())); 1673 background_view->GetRoutingID()));
1674 } 1674 }
1675 } 1675 }
1676 } 1676 }
1677 1677
1678 } // namespace extensions 1678 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/chrome_v8_context.cc ('k') | chrome/renderer/extensions/event_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698