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

Side by Side Diff: src/trusted/plugin/npapi/browser_impl_npapi.h

Issue 3119028: Use console.log to report NaCl errors in Chrome instead of alerts (Closed) Base URL: http://nativeclient.googlecode.com/svn/trunk/src/native_client/
Patch Set: '' Created 10 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright 2010 The Native Client Authors. All rights reserved. 2 * Copyright 2010 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can 3 * Use of this source code is governed by a BSD-style license that can
4 * be found in the LICENSE file. 4 * be found in the LICENSE file.
5 */ 5 */
6 6
7 7
8 // NPAPI implementation of the interface to call browser functionality. 8 // NPAPI implementation of the interface to call browser functionality.
9 9
10 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_NPAPI_BROWSER_IMPL_NPAPI_H_ 10 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_NPAPI_BROWSER_IMPL_NPAPI_H_
(...skipping 25 matching lines...) Expand all
36 // Functions for communication with the browser. 36 // Functions for communication with the browser.
37 virtual uintptr_t StringToIdentifier(const nacl::string& str); 37 virtual uintptr_t StringToIdentifier(const nacl::string& str);
38 // Convert an identifier to a string. 38 // Convert an identifier to a string.
39 virtual nacl::string IdentifierToString(uintptr_t ident); 39 virtual nacl::string IdentifierToString(uintptr_t ident);
40 40
41 // Pops up an alert box. Returns false if that failed for any reason. 41 // Pops up an alert box. Returns false if that failed for any reason.
42 virtual bool Alert(InstanceIdentifier instance_id, 42 virtual bool Alert(InstanceIdentifier instance_id,
43 const nacl::string& text); 43 const nacl::string& text);
44 44
45 // Evaluate a JavaScript string in the browser. 45 // Evaluate a JavaScript string in the browser.
46 virtual bool EvalString(InstanceIdentifier plugin_identifier, 46 virtual bool EvalString(InstanceIdentifier instance_id,
47 const nacl::string& handler_string); 47 const nacl::string& handler_string);
48 48
49 // Write to the JavaScript console. Currently works in Chrome only, generates
50 // an alert in other browsers.
51 virtual bool AddToConsole(InstanceIdentifier instance_id,
52 const nacl::string& text);
53
49 // Gets the full URL of the current page. 54 // Gets the full URL of the current page.
50 bool GetFullURL(InstanceIdentifier instance_id, 55 bool GetFullURL(InstanceIdentifier instance_id,
51 nacl::string* full_url); 56 nacl::string* full_url);
52 57
53 // Creates a browser scriptable handle for a given portable handle. 58 // Creates a browser scriptable handle for a given portable handle.
54 virtual ScriptableHandle* NewScriptableHandle(PortableHandle* handle); 59 virtual ScriptableHandle* NewScriptableHandle(PortableHandle* handle);
55 60
56 private: 61 private:
57 NACL_DISALLOW_COPY_AND_ASSIGN(BrowserImplNpapi); 62 NACL_DISALLOW_COPY_AND_ASSIGN(BrowserImplNpapi);
58 }; 63 };
59 64
60 // Convert from the API-independent instance identifier to the NPAPI NPP. 65 // Convert from the API-independent instance identifier to the NPAPI NPP.
61 NPP InstanceIdentifierToNPP(InstanceIdentifier id); 66 NPP InstanceIdentifierToNPP(InstanceIdentifier id);
62 // Convert from the NPAPI NPP type to the API-independent instance identifier. 67 // Convert from the NPAPI NPP type to the API-independent instance identifier.
63 InstanceIdentifier NPPToInstanceIdentifier(NPP npp); 68 InstanceIdentifier NPPToInstanceIdentifier(NPP npp);
64 69
65 } // namespace plugin 70 } // namespace plugin
66 71
67 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_NPAPI_BROWSER_IMPL_NPAPI_H_ 72 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_NPAPI_BROWSER_IMPL_NPAPI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698