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

Side by Side Diff: chrome/renderer/extensions/app_bindings.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
« no previous file with comments | « no previous file | chrome/renderer/extensions/app_window_custom_bindings.cc » ('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 (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/app_bindings.h" 5 #include "chrome/renderer/extensions/app_bindings.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 IPC_BEGIN_MESSAGE_MAP(AppBindings, message) 206 IPC_BEGIN_MESSAGE_MAP(AppBindings, message)
207 IPC_MESSAGE_HANDLER(ExtensionMsg_GetAppInstallStateResponse, 207 IPC_MESSAGE_HANDLER(ExtensionMsg_GetAppInstallStateResponse,
208 OnAppInstallStateResponse) 208 OnAppInstallStateResponse)
209 IPC_MESSAGE_UNHANDLED(CHECK(false) << "Unhandled IPC message") 209 IPC_MESSAGE_UNHANDLED(CHECK(false) << "Unhandled IPC message")
210 IPC_END_MESSAGE_MAP() 210 IPC_END_MESSAGE_MAP()
211 return true; 211 return true;
212 } 212 }
213 213
214 void AppBindings::OnAppInstallStateResponse( 214 void AppBindings::OnAppInstallStateResponse(
215 const std::string& state, int callback_id) { 215 const std::string& state, int callback_id) {
216 v8::HandleScope handle_scope(context()->isolate()); 216 v8::Isolate* isolate = context()->isolate();
217 v8::HandleScope handle_scope(isolate);
217 v8::Context::Scope context_scope(context()->v8_context()); 218 v8::Context::Scope context_scope(context()->v8_context());
218 v8::Handle<v8::Value> argv[] = { 219 v8::Handle<v8::Value> argv[] = {
219 v8::String::NewFromUtf8(context()->isolate(), state.c_str()), 220 v8::String::NewFromUtf8(isolate, state.c_str()),
220 v8::Integer::New(callback_id) 221 v8::Integer::New(isolate, callback_id)
221 }; 222 };
222 context()->module_system()->CallModuleMethod( 223 context()->module_system()->CallModuleMethod(
223 "app", "onInstallStateResponse", arraysize(argv), argv); 224 "app", "onInstallStateResponse", arraysize(argv), argv);
224 } 225 }
225 226
226 } // namespace extensions 227 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/extensions/app_window_custom_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698