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

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

Issue 594036: Support sending a sliced file in chromium.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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
« no previous file with comments | « build/features_override.gypi ('k') | chrome/browser/renderer_host/resource_message_filter.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 "chrome/browser/chrome_plugin_host.h" 5 #include "chrome/browser/chrome_plugin_host.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 } 649 }
650 650
651 CPError STDCALL CPR_AppendFileToUpload(CPRequest* request, const char* filepath, 651 CPError STDCALL CPR_AppendFileToUpload(CPRequest* request, const char* filepath,
652 uint64 offset, uint64 length) { 652 uint64 offset, uint64 length) {
653 CHECK(ChromePluginLib::IsPluginThread()); 653 CHECK(ChromePluginLib::IsPluginThread());
654 PluginRequestHandler* handler = PluginRequestHandler::FromCPRequest(request); 654 PluginRequestHandler* handler = PluginRequestHandler::FromCPRequest(request);
655 CHECK(handler); 655 CHECK(handler);
656 656
657 if (!length) length = kuint64max; 657 if (!length) length = kuint64max;
658 FilePath path(FilePath::FromWStringHack(UTF8ToWide(filepath))); 658 FilePath path(FilePath::FromWStringHack(UTF8ToWide(filepath)));
659 handler->request()->AppendFileRangeToUpload(path, offset, length); 659 handler->request()->AppendFileRangeToUpload(path, offset, length,
660 base::Time());
660 return CPERR_SUCCESS; 661 return CPERR_SUCCESS;
661 } 662 }
662 663
663 int STDCALL CPR_GetResponseInfo(CPRequest* request, CPResponseInfoType type, 664 int STDCALL CPR_GetResponseInfo(CPRequest* request, CPResponseInfoType type,
664 void* buf, uint32 buf_size) { 665 void* buf, uint32 buf_size) {
665 CHECK(ChromePluginLib::IsPluginThread()); 666 CHECK(ChromePluginLib::IsPluginThread());
666 PluginRequestHandler* handler = PluginRequestHandler::FromCPRequest(request); 667 PluginRequestHandler* handler = PluginRequestHandler::FromCPRequest(request);
667 CHECK(handler); 668 CHECK(handler);
668 return PluginResponseUtils::GetResponseInfo( 669 return PluginResponseUtils::GetResponseInfo(
669 handler->request()->response_headers(), type, buf, buf_size); 670 handler->request()->response_headers(), type, buf, buf_size);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 CPBrowsingContext context) { 817 CPBrowsingContext context) {
817 // Sadly if we try and pass context through, we seem to break cl's little 818 // Sadly if we try and pass context through, we seem to break cl's little
818 // brain trying to compile the Tuple3 ctor. This cast works. 819 // brain trying to compile the Tuple3 ctor. This cast works.
819 int32 context_as_int32 = static_cast<int32>(context); 820 int32 context_as_int32 = static_cast<int32>(context);
820 // Plugins can only be accessed on the IO thread. 821 // Plugins can only be accessed on the IO thread.
821 ChromeThread::PostTask( 822 ChromeThread::PostTask(
822 ChromeThread::IO, FROM_HERE, 823 ChromeThread::IO, FROM_HERE,
823 NewRunnableFunction(PluginCommandHandler::HandleCommand, 824 NewRunnableFunction(PluginCommandHandler::HandleCommand,
824 command, data, context_as_int32)); 825 command, data, context_as_int32));
825 } 826 }
OLDNEW
« no previous file with comments | « build/features_override.gypi ('k') | chrome/browser/renderer_host/resource_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698