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

Side by Side Diff: chrome/browser/plugin_process_host.cc

Issue 195079: Gears File Drag Drop (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 3 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/browser/plugin_process_host.h ('k') | chrome/common/plugin_messages_internal.h » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "chrome/browser/plugin_process_host.h" 7 #include "chrome/browser/plugin_process_host.h"
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <windows.h> 10 #include <windows.h>
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 // Note: We don't have a first_party_for_cookies check because plugins bypass 530 // Note: We don't have a first_party_for_cookies check because plugins bypass
531 // third-party cookie blocking. 531 // third-party cookie blocking.
532 if (context && context->cookie_store()) { 532 if (context && context->cookie_store()) {
533 *cookies = context->cookie_store()->GetCookies(url); 533 *cookies = context->cookie_store()->GetCookies(url);
534 } else { 534 } else {
535 DLOG(ERROR) << "Could not serve plugin cookies request."; 535 DLOG(ERROR) << "Could not serve plugin cookies request.";
536 *cookies = EmptyString(); 536 *cookies = EmptyString();
537 } 537 }
538 } 538 }
539 539
540 void PluginProcessHost::OnAccessFiles(int process_id, 540 void PluginProcessHost::OnAccessFiles(int renderer_id,
541 const std::vector<std::string>& files, 541 const std::vector<std::string>& files,
542 bool* allowed) { 542 bool* allowed) {
543 ChildProcessSecurityPolicy* policy = 543 ChildProcessSecurityPolicy* policy =
544 ChildProcessSecurityPolicy::GetInstance(); 544 ChildProcessSecurityPolicy::GetInstance();
545 545
546 for (size_t i = 0; i < files.size(); ++i) { 546 for (size_t i = 0; i < files.size(); ++i) {
547 const FilePath path = FilePath::FromWStringHack(UTF8ToWide(files[i])); 547 const FilePath path = FilePath::FromWStringHack(UTF8ToWide(files[i]));
548 if (!policy->CanUploadFile(process_id, path)) { 548 if (!policy->CanUploadFile(renderer_id, path)) {
549 LOG(INFO) << "Denied unauthorized request for file " << files[i]; 549 LOG(INFO) << "Denied unauthorized request for file " << files[i];
550 *allowed = false; 550 *allowed = false;
551 return; 551 return;
552 } 552 }
553 } 553 }
554 554
555 *allowed = true; 555 *allowed = true;
556 } 556 }
557 557
558 void PluginProcessHost::OnResolveProxy(const GURL& url, 558 void PluginProcessHost::OnResolveProxy(const GURL& url,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 DCHECK(MessageLoop::current() == 633 DCHECK(MessageLoop::current() ==
634 ChromeThread::GetMessageLoop(ChromeThread::IO)); 634 ChromeThread::GetMessageLoop(ChromeThread::IO));
635 635
636 ChromePluginLib *chrome_plugin = ChromePluginLib::Find(info_.path); 636 ChromePluginLib *chrome_plugin = ChromePluginLib::Find(info_.path);
637 if (chrome_plugin) { 637 if (chrome_plugin) {
638 void *data_ptr = const_cast<void*>(reinterpret_cast<const void*>(&data[0])); 638 void *data_ptr = const_cast<void*>(reinterpret_cast<const void*>(&data[0]));
639 uint32 data_len = static_cast<uint32>(data.size()); 639 uint32 data_len = static_cast<uint32>(data.size());
640 chrome_plugin->functions().on_message(data_ptr, data_len); 640 chrome_plugin->functions().on_message(data_ptr, data_len);
641 } 641 }
642 } 642 }
OLDNEW
« no previous file with comments | « chrome/browser/plugin_process_host.h ('k') | chrome/common/plugin_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698