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

Side by Side Diff: ppapi/native_client/src/trusted/plugin/plugin.cc

Issue 9381010: Convert resources to take an instance key instead of an Instance*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: USELESS PATCH TITLE Created 8 years, 9 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 // 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 #ifdef _MSC_VER 5 #ifdef _MSC_VER
6 // Do not warn about use of std::copy with raw pointers. 6 // Do not warn about use of std::copy with raw pointers.
7 #pragma warning(disable : 4996) 7 #pragma warning(disable : 4996)
8 #endif 8 #endif
9 9
10 #include "native_client/src/trusted/plugin/plugin.h" 10 #include "native_client/src/trusted/plugin/plugin.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 333 }
334 return 0; 334 return 0;
335 } 335 }
336 336
337 pp::Resource PrintPages(const PP_PrintPageNumberRange_Dev* page_ranges, 337 pp::Resource PrintPages(const PP_PrintPageNumberRange_Dev* page_ranges,
338 uint32_t page_range_count) { 338 uint32_t page_range_count) {
339 if (ppp_printing_ != NULL) { 339 if (ppp_printing_ != NULL) {
340 PP_Resource image_data = ppp_printing_->PrintPages(plugin_->pp_instance(), 340 PP_Resource image_data = ppp_printing_->PrintPages(plugin_->pp_instance(),
341 page_ranges, 341 page_ranges,
342 page_range_count); 342 page_range_count);
343 return pp::ImageData(pp::ImageData::PassRef(), image_data); 343 return pp::ImageData(pp::PASS_REF, image_data);
344 } 344 }
345 return pp::Resource(); 345 return pp::Resource();
346 } 346 }
347 347
348 void PrintEnd() { 348 void PrintEnd() {
349 if (ppp_printing_ != NULL) 349 if (ppp_printing_ != NULL)
350 ppp_printing_->End(plugin_->pp_instance()); 350 ppp_printing_->End(plugin_->pp_instance());
351 } 351 }
352 352
353 bool IsPrintScalingDisabled() { 353 bool IsPrintScalingDisabled() {
(...skipping 22 matching lines...) Expand all
376 BrowserPpp* proxy = plugin_->ppapi_proxy(); 376 BrowserPpp* proxy = plugin_->ppapi_proxy();
377 CHECK(proxy != NULL); 377 CHECK(proxy != NULL);
378 ppp_selection_ = static_cast<const PPP_Selection_Dev*>( 378 ppp_selection_ = static_cast<const PPP_Selection_Dev*>(
379 proxy->GetPluginInterface(PPP_SELECTION_DEV_INTERFACE)); 379 proxy->GetPluginInterface(PPP_SELECTION_DEV_INTERFACE));
380 } 380 }
381 381
382 pp::Var GetSelectedText(bool html) { 382 pp::Var GetSelectedText(bool html) {
383 if (ppp_selection_ != NULL) { 383 if (ppp_selection_ != NULL) {
384 PP_Var var = ppp_selection_->GetSelectedText(plugin_->pp_instance(), 384 PP_Var var = ppp_selection_->GetSelectedText(plugin_->pp_instance(),
385 PP_FromBool(html)); 385 PP_FromBool(html));
386 return pp::Var(pp::Var::PassRef(), var); 386 return pp::Var(pp::PASS_REF, var);
387 } 387 }
388 return pp::Var(); 388 return pp::Var();
389 } 389 }
390 390
391 private: 391 private:
392 Plugin* plugin_; 392 Plugin* plugin_;
393 const PPP_Selection_Dev* ppp_selection_; 393 const PPP_Selection_Dev* ppp_selection_;
394 394
395 NACL_DISALLOW_COPY_AND_ASSIGN(SelectionAdapter); 395 NACL_DISALLOW_COPY_AND_ASSIGN(SelectionAdapter);
396 }; 396 };
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 // and 'nacl' will be the URL for the manifest. 818 // and 'nacl' will be the URL for the manifest.
819 manifest_url = LookupArgument(kNaClManifestAttribute); 819 manifest_url = LookupArgument(kNaClManifestAttribute);
820 // For content handlers the NEXE runs in the security context of the 820 // For content handlers the NEXE runs in the security context of the
821 // content it is rendering and the NEXE itself appears to be a 821 // content it is rendering and the NEXE itself appears to be a
822 // cross-origin resource stored in a Chrome extension. 822 // cross-origin resource stored in a Chrome extension.
823 } 823 }
824 // Use the document URL as the base for resolving relative URLs to find the 824 // Use the document URL as the base for resolving relative URLs to find the
825 // manifest. This takes into account the setting of <base> tags that 825 // manifest. This takes into account the setting of <base> tags that
826 // precede the embed/object. 826 // precede the embed/object.
827 CHECK(url_util_ != NULL); 827 CHECK(url_util_ != NULL);
828 pp::Var base_var = url_util_->GetDocumentURL(*this); 828 pp::Var base_var = url_util_->GetDocumentURL(this);
829 if (!base_var.is_string()) { 829 if (!base_var.is_string()) {
830 PLUGIN_PRINTF(("Plugin::Init (unable to find document url)\n")); 830 PLUGIN_PRINTF(("Plugin::Init (unable to find document url)\n"));
831 return false; 831 return false;
832 } 832 }
833 set_plugin_base_url(base_var.AsString()); 833 set_plugin_base_url(base_var.AsString());
834 if (manifest_url == NULL) { 834 if (manifest_url == NULL) {
835 // TODO(sehr,polina): this should be a hard error when scripting 835 // TODO(sehr,polina): this should be a hard error when scripting
836 // the src property is no longer allowed. 836 // the src property is no longer allowed.
837 PLUGIN_PRINTF(("Plugin::Init:" 837 PLUGIN_PRINTF(("Plugin::Init:"
838 " WARNING: no 'src' property, so no manifest loaded.\n")); 838 " WARNING: no 'src' property, so no manifest loaded.\n"));
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
1917 static_cast<uint32_t>(text.size())); 1917 static_cast<uint32_t>(text.size()));
1918 const PPB_Console_Dev* console_interface = 1918 const PPB_Console_Dev* console_interface =
1919 static_cast<const PPB_Console_Dev*>( 1919 static_cast<const PPB_Console_Dev*>(
1920 module->GetBrowserInterface(PPB_CONSOLE_DEV_INTERFACE)); 1920 module->GetBrowserInterface(PPB_CONSOLE_DEV_INTERFACE));
1921 console_interface->LogWithSource(pp_instance(), PP_LOGLEVEL_LOG, prefix, str); 1921 console_interface->LogWithSource(pp_instance(), PP_LOGLEVEL_LOG, prefix, str);
1922 var_interface->Release(prefix); 1922 var_interface->Release(prefix);
1923 var_interface->Release(str); 1923 var_interface->Release(str);
1924 } 1924 }
1925 1925
1926 } // namespace plugin 1926 } // namespace plugin
OLDNEW
« no previous file with comments | « ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_testing_rpc_server.cc ('k') | ppapi/ppapi_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698