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

Unified Diff: chrome/browser/plugin_process_host.cc

Issue 159074: CPAPI (0.11) for gears drag drop.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/plugin_process_host.h ('k') | chrome/common/chrome_plugin_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_process_host.cc
===================================================================
--- chrome/browser/plugin_process_host.cc (revision 20372)
+++ chrome/browser/plugin_process_host.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -27,6 +27,7 @@
#include "base/scoped_ptr.h"
#include "base/thread.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/child_process_security_policy.h"
#include "chrome/browser/chrome_plugin_browsing_context.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/plugin_service.h"
@@ -444,6 +445,7 @@
OnGetPluginFinderUrl)
IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginMessage, OnPluginMessage)
IPC_MESSAGE_HANDLER(PluginProcessHostMsg_GetCookies, OnGetCookies)
+ IPC_MESSAGE_HANDLER(PluginProcessHostMsg_AccessFiles, OnAccessFiles)
IPC_MESSAGE_HANDLER_DELAY_REPLY(PluginProcessHostMsg_ResolveProxy,
OnResolveProxy)
#if defined(OS_WIN)
@@ -512,6 +514,24 @@
*cookies = context->cookie_store()->GetCookies(url);
}
+void PluginProcessHost::OnAccessFiles(int process_id,
+ const std::vector<std::string>& files,
+ bool* allowed) {
+ ChildProcessSecurityPolicy* policy =
+ ChildProcessSecurityPolicy::GetInstance();
+
+ for (size_t i = 0; i < files.size(); ++i) {
+ const FilePath path = FilePath::FromWStringHack(UTF8ToWide(files[i]));
+ if (!policy->CanUploadFile(process_id, path)) {
+ LOG(INFO) << "Denied unauthorized request for file " << files[i];
+ *allowed = false;
+ return;
+ }
+ }
+
+ *allowed = true;
+}
+
void PluginProcessHost::OnResolveProxy(const GURL& url,
IPC::Message* reply_msg) {
resolve_proxy_msg_helper_.Start(url, reply_msg);
« no previous file with comments | « chrome/browser/plugin_process_host.h ('k') | chrome/common/chrome_plugin_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698